<template>
	<sl-page title="设置">
		<view class="configuration">
			<!-- <view class="flex flex-x-between" @click="toTargetPage(pages.addressIndexPage)">
				<view class="flex">
					<text>消息设置：</text>
				</view>
				<uni-icons type="forward" size="18"></uni-icons>
			</view>
			<view class="configuration-line"></view> -->
			<view class="flex flex-x-between" @click="toTargetPage(pages.agreementIndexPage)">
				<view class="flex">
					<text>用户协议：</text>
				</view>
				<uni-icons type="forward" size="18"></uni-icons>
			</view>
			<!-- <view class="configuration-line"></view>
			<view class="flex flex-x-between" @click="toTargetPage(pages.billIndexPage)">
				<view class="flex">
					<text>消费账单：</text>
				</view>
				<uni-icons type="forward" size="18"></uni-icons>
			</view> -->
			<view class="configuration-line"></view>
			<view class="flex flex-x-center" @click="handleLogout()">
				<view class="flex">
					<text>退出登陆</text>
				</view>
			</view>
		</view>
	</sl-page>
</template>

<script>
	import Constants from '@/constants';
	//
	export default {
		//
		mixins: [Constants],
		//
		data() {
			return {
			};
		},
		//
		onLoad() {

		},
		//
		onShow() {},
		//
		methods: {
			toTargetPage(url, params) {
				// console.log('url: ', url);
				this.$app.navTo(url, params);
			},
			//退出登录
			handleLogout() {
				const app = this;
				app.$app.confirm('您确定要退出登录吗?', () => {
					app.$store.dispatch('Logout', {}).then(
						res => {
							uni.navigateBack();
						}
					);
				});
			},
		}
	};
</script>

<style lang="scss" scoped>
	.configuration {
		display: flex;
		flex-direction: column;
		background: $uni-bg-color;
		padding: $xj-standard-padding;
		border-radius: $xj-standard-border-radius;
		font-size: $uni-font-size-base;
		color: $uni-text-color-primary;
		font-weight: 500;
		margin: 24rpx 32rpx;

		.configuration-line {
			width: 622rpx;
			height: 2rpx;
			background: #EEEEEE;
			margin: 28rpx 0rpx;
		}
	}
</style>